Hi Toby,
Sorry I thought I replied to this already. Yes that is the only way I know of to do this: Request the Amount of Motion Time executed from KFLOP then work backwards in the active circular Trajectory Planner buffer Starting at the total SegsDoneTime[index] to find the corresponding segment. There is probably some multi-thread issues since your search Thread would be different from the Interpreter Thread that is changing the buffer, pointers, and times. There is an example in the CheckMotionHalt function in CoordMotion, but it only does this after a halt and the buffer stops changing and by the same Interpreter Thread so there are no multi-thread issues in that case. I suppose the solution would have to be mutex protect all accesses to the buffer pointers and times. If you find a way to modify the .NET API to make this possible we would certainly incorporate your changes.
Regards
TK
Group: DynoMotion |
Message: 5905 |
From: Toby Rule |
Date: 10/26/2012 |
Subject: Re: Current segment |
Hi Tom, Thanks for the reply. Searching the tool-path geometry will probably get the job done, at least for the first version. I appreciate the tip on thread-safety. If/when I resort to modifying KMotion.NET, then I’ll send you a patch. Regards, Toby From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes Sent: Thursday, October 25, 2012 5:41 PM To: DynoMotion@yahoogroups.com Subject: Re: [DynoMotion] RE: Current segment Sorry I thought I replied to this already. Yes that is the only way I know of to do this: Request the Amount of Motion Time executed from KFLOP then work backwards in the active circular Trajectory Planner buffer Starting at the total SegsDoneTime[index] to find the corresponding segment. There is probably some multi-thread issues since your search Thread would be different from the Interpreter Thread that is changing the buffer, pointers, and times. There is an example in the CheckMotionHalt function in CoordMotion, but it only does this after a halt and the buffer stops changing and by the same Interpreter Thread so there are no multi-thread issues in that case. I suppose the solution would have to be mutex protect all accesses to the buffer pointers and times. If you find a way to modify the .NET API to make this possible we would certainly incorporate your changes. From: Toby Rule <trule@...> To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com> Sent: Thursday, October 25, 2012 1:45 PM Subject: [DynoMotion] RE: Current segment I would be very grateful for any comments on this issue. From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Toby Rule Sent: Friday, October 19, 2012 9:46 AM To: DynoMotion@yahoogroups.com Subject: [DynoMotion] Current segment Is there a way to get the current segment being processed in KMotion.NET API? I know I can get the last segment in the buffer, but I want to get the actual segment being operated on by the motion controller. Several years ago, when I was working with the C++ API, I remember that I achieved this result by getting the last segment in the buffer, the time in the buffer, and the elapsed time for previous segments (I think I had to modify GCodeInterpreter to expose the time per segment properties), and worked backwards to get to the current segment. At least I think that’s what I did… To do the same thing in KMotion.net, it appears I would have to modify the API. Right now I’m using the real-time position and direction of motion to search the tool path and find the current segment. This isn’t always very reliable, however, especially when segments overlap.
The information contained in this transmission is intended only for the person or entity
to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive
material. If you are not the intended recipient, please contact the sender immediately
and destroy the material in its entirety, whether electronic or hard copy. You are
notified that any review, retransmission, copying, disclosure, dissemination or other
use of, or taking of any action in reliance upon this information by persons or entities
other than the intended recipient is prohibited.
|
|
| |